<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			var mostCommonWord = function(paragraph, banned) {
			    let str = paragraph.toLocaleLowerCase().match(/[A-Za-z]+/g);
			    let map = new Map();
			    str.forEach((item) => {
			        if (map.has(item)) {
			            map.set(item, map.get(item) + 1);
			        } else {
			            map.set(item, 1);
			        }
			    })
			    let reuslt = '';
			    let count = 0;
			    for(let [key, val] of map.entries()) {
			        if (val > count && !banned.includes(key)) {
			            count = val;
			            reuslt = key;
			        }
			    }
			    return reuslt;
			};
			console.log(mostCommonWord("Bob hit a ball, the hit BALL flew far after it was hit.",["hit"]));
		</script>
	</body>
</html>
